package models;

import com.avaje.ebean.Model;
import play.data.validation.Constraints;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Permission entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "permission")
public class Permission extends Model{

	@Id
	@Constraints.Min(10)
	public Long permissionId;

	public String permissionDes;

	public Boolean permissionRead;

	public Boolean permissionAdd;

	public Boolean permissionDelete;

	public Boolean permissionUpdate;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "permission")
	public Set<UserPermissionManytomany> userPermissionManytomanies = new HashSet<UserPermissionManytomany>(
			0);

	public static Model.Finder<Long, Permission> find = new Model.Finder<>(Permission.class);
}